#include <linux/module.h> 
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>


#define GPX2CON 0x11000C40
#define GPX2DAT 0x11000C44
#define GPX1CON 0x11000C20
#define GPX1DAT 0x11000C24
#define GPF3CON 0x114001E0
#define GPF3DAT 0x114001E4

static void device_release(struct device *dev)
{
	printk("led_device release\n");
}

struct resource resources[] = {
	[0] = {.start =  GPX2CON, .end = GPX2CON + 3, .name = "GPX2CON", IORESOURCE_MEM},
	[1] = {.start =  GPX2DAT, .end = GPX2DAT + 3, .name = "GPX2DAT", IORESOURCE_MEM},
	[2] = {.start =  GPX1CON, .end = GPX1CON + 3, .name = "GPX1CON", IORESOURCE_MEM},
	[3] = {.start =  GPX1DAT, .end = GPX1DAT + 3, .name = "GPX1DAT", IORESOURCE_MEM},
	[4] = {.start =  GPF3CON, .end = GPF3CON + 3, .name = "GPF3CON", IORESOURCE_MEM},
	[5] = {.start =  GPF3DAT, .end = GPF3DAT + 3, .name = "GPF3DAT", IORESOURCE_MEM},
};


struct platform_device test_device = {
	
	.name = "led_device",
	.dev.release = device_release, 
	.resource = resources,
	.num_resources = ARRAY_SIZE(resources)

};

static int __init led_device_init(void)
{
	platform_device_register(&test_device);
	return 0;
}

static void __exit led_device_exit(void)
{
	platform_device_unregister(&test_device);
}

module_init(led_device_init);
module_exit(led_device_exit);
MODULE_LICENSE("Dual BSD/GPL");
